<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<link type="text/css" rel="stylesheet" href="/Public/Admin/css/style.css" />
	<script type="text/javascript" src="/Public/Admin/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="/Public/Admin/js/menu.js"></script>
	<style type="text/css">
		#addform{
			
			margin: 15px auto 10px auto;
		}
		table{
			width: 100%;
			text-align: center;
			margin-left: auto;
			margin-right: auto;
		}
		table th{
			background-color: #11B6B6;
			color: white;
			font-family: "微软雅黑";
		}
		#pageinfo{
			margin: 15px auto;
			text-align: center;
		}
		#dotop{
			width: 400px;
			background: white;
			height: 150px;
			border: solid 3px #DDDDDD;
			position: absolute;
			top: 25%;
			left: 25%;
			display: none;
			
		}
		#dotop p{
			margin-top: 40px;
			margin-left: 20px;
		}
		#spanX{
			position: absolute;
			top: 2px;
			right: 3px;
		}
	</style>
</head>
<body>
	<div class="right-nav">
          <ul>
              <li><img src="/Public/Admin/images/home.png"></li>
                <li style="margin-left:25px;">您当前的位置：</li>
                <li><a href="/index.php/Admin/Index/index">内容管理</a></li>
                <li>></li>
                <li><a href="/index.php/Admin/Info/index">供求信息管理</a></li>
            </ul>
      </div>
	<div id="addform">
		<form action="/index.php/Admin/Info/index" method="get">
			
				<span>置顶:</span><input type="checkbox" name="is_top" value="1" />　
				<span>审核:</span><input type="checkbox" name="is_varify" value="1" />　
				<span>是否过期:</span>
				<input type="radio" name="is_overtime"  value="1" />是
				<input type="radio" name="is_overtime"  value="0" />否　
				<select name="area_id">
					<option value="">请选择</option>
					<?php if(is_array($areas)): foreach($areas as $key=>$area): ?><option value="<?php echo ($area["id"]); ?>"><?php echo ($area["area_name"]); ?></option><?php endforeach; endif; ?>
				</select>
				<span>标题模糊查询: </span><input type="text" name="keyword"/>
				<input type="submit" value="查找" />
		</form>
	</div>
	
	<table id="tab" >
		<tr><th width="30%">消息标题</th>
			<th>发布人</th>
			<th>地区</th>
			<th>价格(¥)</th>
			<th>发布时间</th>
			<th>图片数量</th>
			<th>浏览次数</th>
			<th>是否审核</th>
			<th>是否过期</th>
			<th>设置置顶</th>
			<th>删除</th>
		</tr>
		
		<?php if(is_array($infos)): foreach($infos as $key=>$info): ?><tr>
			<td><a title="<?php echo ($info["info_content"]); ?>" href="#"><?php echo ($info["info_title"]); ?></a></td>
			<td><?php echo ($info["user_name"]); ?></td>
			<td><?php echo ($info["area_name"]); ?></td>
			<td><?php echo ($info["info_price"]); ?></td>
			<td><?php echo ($info["info_createtime"]); ?></td>
			<td><?php echo ($info["img_num"]); ?></td>
			<td><?php echo ($info["info_num"]); ?></td>
			<td>
				<?php if($info["is_varify"] == 0): ?><a href="/index.php/Admin/Info/dovarify/info_id/<?php echo ($info["info_id"]); ?>" onclick="JavaScript:return confirm('确认要审核吗?')">审核</a>
				<?php else: ?><img src="/Public/Admin/images/yes.gif" alt=""><?php endif; ?>
			</td>
			<td><img src="/Public/Admin/images/<?php echo ($info["is_overtime"]); ?>.gif" alt=""></td>
			<td>
				<?php if($info["is_top"] == 0): ?><a href="JavaScript:;" onclick="dotop('<?php echo ($info["info_id"]); ?>','<?php echo ($info["info_title"]); ?>')">置顶</a>
				<?php else: ?><a title="<?php echo ($info["top_overtime"]); ?>" href="/index.php/Admin/Info/cleartop/info_id/<?php echo ($info["info_id"]); ?>" onclick="return confirm('确认要取消置顶吗?')">取消置顶</a><?php endif; ?>
			</td>
			
			
			<td><a href="/index.php/Admin/Info/delete/id/<?php echo ($info["info_id"]); ?>" onclick="JavaScript:return confirm('确认要删除吗?')">删除</a></td>
		</tr><?php endforeach; endif; ?>
	</table>
	<div id="dotop">
		<form action="/index.php/Admin/Info/dotop" method="post">
			<p><span>置顶标题:</span>
				<input type="text" id="updatainput" name="info_title" readonly="readonly"/><br />
				<span>置顶天数:</span>
				<input type="number" id="top_overtime" name="top_overtime" style="width: 50px;"/>天
				<input type="hidden" id="infoid" name="info_id"value="" />
				<input type="submit" value="置顶" />
			</p>
		<span id="spanX"><a href="JavaScript:;">×</a></span>
	</form>
	</div>
	<p id="pageinfo"><?php echo ($pageinfo); ?></p>
	<script type="text/javascript">
		function dotop(id,info_title){
			document.getElementById("dotop").style.display="block";
			document.getElementById("infoid").value=id;
			document.getElementById("updatainput").value=info_title;
		}
		var closewind=document.getElementById("spanX");
		closewind.onclick=function(){
			document.getElementById("dotop").style.display="none";
		}
	</script>
	
</body>
</html>